from enum import Enum


class Suite(Enum):
    SPADE, HEART, CLUB, DIAMOND = range(4)


for suite in Suite:
    print(f'{suite}: {suite.value}')


class Card:
    def __init__(self, suite, face):
        self.suite = suite
        self.face = face

    def __repr__(self):
        suites = '♠♥♣♦'
        faces = ['', 'A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K']
        return f'{suites[self.suite.value]}{faces[self.face]}'

    def __lt__(self, other):
        if self.suite == other.suite:
            return self.face < other.face
        else:
            # return self.face<other.face
            return self.suite.value < other.suite.value


c1 = Card(Suite.HEART, 13)
c2 = Card(Suite.SPADE, 10)

import random


class Poker:
    def __init__(self):
        self.cards = [Card(suite, face) for suite in Suite for face in range(1, 14)]
        self.current = 0

    def shuffle(self):
        self.current = 0
        random.shuffle(self.cards)

    def deal(self):
        card = self.cards[self.current]
        self.current += 1
        return card

    def hasNext(self):
        return self.current < len(self.cards)


poker = Poker()
print(poker.cards)
poker.shuffle()
print(poker.cards)


class Player():
    def __init__(self, name):
        self.name = name
        self.cards = []

    def get_one(self, card):
        self.cards.append(card)

    def arrange(self):
        self.cards.sort()


players = [Player('梁晟'), Player('周慧敏'), Player('李嘉欣'), Player('邱淑贞')]
for _ in range(13):
    for player in players:
        player.get_one(poker.deal())


def showPoker():
    for player in players:
        print(f'{player.name}', end='\t')
        print(f'{player.cards}')


showPoker()
for p in players:
    p.arrange()
showPoker()
